{% extends 'base.html' %}

{% block content %}

    <div class="container mt-3">
        <div class="row">
            <div class="col-6"><h1>共有{{ customers|length }}条</h1></div>
            <div class="col-6">
                <form class="d-flex" method="post">
                    <input class="form-control me-2" type="int" name="gyid" placeholder="输入ID查找">
                    <button class="btn btn-primary" type="submit">Search</button>
                </form>
            </div>

        </div>

        <table class="table table-striped">
            <thead>
            <tr>
                <th>ID</th>
                <th>标题</th>
                <th>内容</th>
                <th>时间</th>
                <th>编辑</th>
            </tr>
            </thead>
            <tbody>
            {% for customer in customers %}
              <tr>
                 {% if customer.statu %}
                    <td class="table-success">{{ customer.id }}</td>
                    <td class="table-success">{{ customer.title }}</td>
                {% else %}
                    <td class="table-danger">{{ customer.id }}</td>
                    <td class="table-danger">{{ customer.title }}</td>
                {% endif %}
                    <td class="">{{ customer.detail }}</td>
                    <td>{{ customer.time }}</td>
                    <td><a type="button" href="{{ url_for('edit', customer_id = customer.id) }}">edit</a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

{% endblock %}
